package com.swak.persistence.mybatis.methods.impls;

import com.swak.persistence.mybatis.methods.AbstractMethod;
import com.swak.persistence.mybatis.methods.Sqls;

@Deprecated
public class Version extends AbstractMethod {

	@Override
	protected void doInject() {
		if (!this.supportMethod(Sqls.VERSION)) {
			return;
		}

		String sql = new StringBuilder().append(SELECT).append(SPACE).append("VERSION").append(SPACE).append(FROM)
				.append(SPACE).append(this.table.getName()).append(SPACE)
				.append(this.parseWhereLogicDelEqualColumn(false)).append(this.parsePkEqualColumns()).append(SPACE)
				.toString();

		this.addSelectMappedStatementForOther(Sqls.VERSION.getMethod(), sql, Integer.class);
	}
}